#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include "log.h"

void LOG(const char *format, ...)
{
    char buffer[LOG_BUFFER_SIZE];
    va_list args;
    va_start(args, format);
    int length = vsnprintf(buffer, LOG_BUFFER_SIZE, format, args);
    va_end(args);
    if (length > 0)
        HAL_UART_Transmit(&DEBUG_UART, (uint8_t *)buffer, length, HAL_MAX_DELAY);
}
